package zhongbo.java.air.dictionary.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.domain.Pageable;
import zhongbo.java.air.dictionary.model.AirAircraft;
import zhongbo.java.air.dictionary.model.AirAlertZone;

import java.util.List;

/**
 * 飞机基础信息表(AirAircraft)表数据库访问层
 *
 * @author makejava
 * @since 2025-03-31 13:55:14
 */
@Mapper
public interface AirAircraftMapper extends BaseMapper<AirAircraft> {


    /**
     * 查询指定行数据
     *
     * @param offset 偏移量
     * @param pageSize         大小
     * @return 对象列表
     */
    @Select("SELECT * FROM air_aircraft ORDER BY id LIMIT #{pageSize} OFFSET #{offset}")
    List<AirAircraft> queryAllByLimit(@Param("offset") int offset, @Param("pageSize") int pageSize);
    //获取icaoCode
    @Select("SELECT * FROM air_aircraft WHERE icao_code = #{icaoCode}")
    AirAircraft selectByIcaoCode(@Param("icaoCode") String icaoCode);
    //获取registration
    @Select("SELECT * FROM air_aircraft WHERE registration = #{registration}")
    AirAircraft selectByRegistration(@Param("registration") String registration);


}

